Function at 0x1004f8d0
Capabilities:
Get thread local storage value
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, edx
mov dword [ebp - 0x10], ecx
push edi
mov dword [ebp - 0x1c], esi
mov edx, dword [esi + 0x7128]
mov edi, edx
mov ebx, dword [esi + 0x712c]
sub edi, 1
mov eax, ebx
mov dword [esi + 0x7128], edi
sbb eax, 0
mov dword [esi + 0x712c], eax
test ebx, ebx
jg 0x1004f915
jl 0x1004fa37
test edx, edx
jb 0x1004fa37
cmp dword [esi + 0x18370], 0
jne 0x1004fe73
cmp dword [esi + 0x34], 0
je 0x1004fa47
cmp dword [esi + 0x3c], 0
mov byte [esi + 0x1837c], 0
je 0x1004f94f
xor eax, eax
mov byte [esi + 0x1837c], 1
mov dword [ebp - 0xc], eax
xor edi, edi
mov dword [esi + 4], eax
jmp 0x1004f9d2
mov ecx, dword [esi + 0x80]
test ebx, ebx
jg 0x1004f962
jl 0x1004f95f
cmp edx, ecx
jae 0x1004f962
lea ecx, [edi + 1]
mov edx, dword [esi + 0x40]
xor edi, edi
mov ebx, dword [esi + 0x18368]
mov eax, 3
mov dword [ebp - 0x14], edx
mov edx, dword [esi + 0x44]
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 0x14]
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], eax
test ecx, ecx
je 0x1004f9d2
cmp eax, 3
jne 0x1004f9d2
lea eax, [ebp - 0xc]
sub ecx, edi
push eax
push dword [esi + 0x7154]
lea eax, [ebp - 8]
mov dword [ebp - 8], ecx
push dword [esi + 0x4c]
push dword [esi + 0x48]
push dword [ebp - 0x18]
push edx
push eax
mov eax, dword [esi + 0x7150]
push ebx
push 0
call eax
mov eax, dword [ebp - 8]
add edi, eax
mov edx, dword [ebp - 0x14]
add ebx, eax
mov ecx, dword [ebp - 4]
add edx, eax
mov eax, dword [ebp - 0xc]
adc dword [ebp - 0x18], 0
mov dword [ebp - 0x14], edx
cmp edi, ecx
jb 0x1004f988
mov dword [ebp - 8], edi
cmp eax, 3
ja case.default.0x1004f9da
jmp dword [eax*4 + 0x1004fec0]
mov dword [esi + 0x18370], edi
test edi, edi
je 0x1004f9fe
add dword [esi + 0x40], edi
adc dword [esi + 0x44], 0
xor ecx, ecx
test eax, eax
sete cl
mov dword [esi + 0x3c], ecx
jmp case.default.0x1004f9da
mov ecx, 1
mov byte [esi + 0x1837c], 1
mov dword [esi + 0x3c], ecx
jmp case.default.0x1004f9da
mov dword [esi + 0x18370], 0xffffffff
mov byte [esi + 0x1837c], 1
cmp dword [esi + 0x18370], 0
ja 0x1004fbec
cmp dword [esi + 0x3c], 0
jne 0x1004feb4
mov byte [esi + 0x1837c], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x80]
test ebx, ebx
jg 0x1004fa5a
jl 0x1004fa57
cmp edx, eax
jae 0x1004fa5a
lea eax, [edi + 1]
mov dword [ebp - 4], eax
test eax, eax
je 0x1004feb4
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 8]
push 0
push ecx
push eax
push dword [esi + 0x18368]
push dword [esi + 0x18380]
call ebx
mov ecx, dword [ebp - 4]
lea edx, [esi + 0x1837c]
cmp eax, 1
jne 0x1004faa5
mov eax, dword [ebp - 8]
sub ecx, eax
mov dword [esi + 0x18370], eax
mov dword [ebp - 4], ecx
mov byte [edx], 0
test eax, eax
je 0x1004fab3
jmp 0x1004faaf
mov dword [esi + 0x18370], 0xffffffff
test ecx, ecx
je 0x1004fad0
cmp dword [esi + 0x82a8], 0
jne 0x1004fadd
test ecx, ecx
je 0x1004feb4
mov byte [edx], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x82a8], 0
je 0x1004fbec
cmp dword [esi + 0x18370], 0
jbe 0x1004faee
test ecx, ecx
je 0x1004fbec
mov eax, dword [esi + 0x81e2]
cmp eax, 0xffffffff
je 0x1004fb05
cmp dword [esi + 0x82ac], eax
jge 0x1004feb4
call fcn.10045da0
mov edx, dword [esi + 0x81e2]
mov ecx, dword [esi + 0x82ac]
push esi
lea eax, [edx + 1]
inc edx
neg edx
sbb edx, edx
add ecx, 2
and edx, eax
call fcn.1004cb30
add esp, 4
cmp eax, 1
jne 0x1004fca3
call fcn.10045e20
cmp eax, 0xffffffff
jne 0x1004fb44
mov ecx, dword [ebp - 4]
jmp 0x1004fad0
mov edx, dword [esi + 0x18370]
test edx, edx
jne 0x1004fb54
mov dword [esi + 0x18370], edx
mov ecx, dword [ebp - 4]
test ecx, ecx
jne 0x1004fb99
mov edi, dword [esi + 0x7128]
mov edx, edi
mov eax, dword [esi + 0x712c]
add edx, 1
mov ecx, dword [esi + 0x80]
adc eax, 0
test eax, eax
jg 0x1004fb82
jl 0x1004fb7f
cmp edx, ecx
jae 0x1004fb82
lea ecx, [edi + 1]
xor edx, edx
mov dword [ebp - 4], ecx
mov dword [esi + 0x18370], 0
test ecx, ecx
je 0x1004fc8e
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [esi + 0x18368]
push ecx
add eax, edx
push eax
push dword [esi + 0x18380]
call ebx
cmp eax, 1
jne 0x1004fbd6
mov eax, dword [ebp - 8]
test eax, eax
je 0x1004fbd6
mov ecx, dword [ebp - 4]
add dword [esi + 0x18370], eax
sub ecx, eax
inc dword [esi + 0x82ac]
mov dword [ebp - 4], ecx
jmp 0x1004fad0
mov byte [esi + 0x1837c], 1
call fcn.10045da0
mov dword [esi + 0x18370], 0
cmp dword [esi + 0x38], 0
je 0x1004fcbc
mov ecx, dword [esi + 0x18370]
test ecx, ecx
je 0x1004fcbc
mov edi, dword [esi + 0x7128]
mov edx, edi
mov eax, dword [esi + 0x712c]
add edx, 1
adc eax, 0
xor ebx, ebx
cmp ebx, eax
jl 0x1004fc27
jg 0x1004fc24
cmp ecx, edx
jbe 0x1004fc27
lea ecx, [edi + 1]
lea eax, [ebp - 0xc]
mov dword [ebp - 4], ecx
push eax
push dword [esi + 0x7154]
lea eax, [ebp - 4]
mov dword [ebp - 0xc], 3
push dword [esi + 0x4c]
push dword [esi + 0x48]
push dword [esi + 0x44]
push dword [esi + 0x40]
push eax
push dword [esi + 0x18368]
mov eax, dword [esi + 0x7150]
push 2
call eax
mov eax, dword [ebp - 0xc]
sub eax, 0
je 0x1004fc6d
sub eax, 1
je 0x1004fc6d
sub eax, 1
jne 0x1004fcbc
mov dword [esi + 0x18370], 0xffffffff
mov byte [esi + 0x1837c], 1
mov dword [esi + 4], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
inc dword [esi + 0x82ac]
mov dword [esi + 0x18370], 0
jmp 0x1004fbec
cmp eax, 2
jne 0x1004feb4
mov dword [esi + 4], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x82b0], 0
mov ebx, dword [esi + 0x18368]
mov dword [ebp - 0x18], ebx
mov dword [esi + 0x1836c], ebx
je 0x1004fe70
mov eax, dword [esi + 0x1f55c]
sub eax, 1
je 0x1004fdcd
sub eax, 1
je 0x1004fdcd
sub eax, 6
mov eax, dword [esi + 0x712c]
je 0x1004fd78
mov edx, dword [esi + 0x7128]
mov ecx, edx
mov edi, dword [esi + 0x18370]
add ecx, 1
adc eax, 0
xor ebx, ebx
cmp ebx, eax
jl 0x1004fd1e
jg 0x1004fd1b
cmp edi, ecx
jbe 0x1004fd1e
lea edi, [edx + 1]
test edi, edi
je 0x1004fe70
mov esi, dword [ebp - 0x18]
lea esp, [esp]
push dword [0x100c7608]
dec edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x1004fd5d
mov ax, word [eax + 0x8340]
or ax, 2
movzx eax, ax
mov ecx, eax
xor ecx, 1
imul ecx, eax
movzx eax, cx
shr eax, 8
movzx ebx, byte [esi]
xor ebx, eax
mov ecx, ebx
call fcn.100516b0
mov byte [esi], bl
inc esi
test edi, edi
jne 0x1004fd30
mov esi, dword [ebp - 0x1c]
jmp 0x1004fe70
mov edi, dword [esi + 0x7128]
mov edx, edi
mov ecx, dword [esi + 0x18370]
add edx, 1
mov dword [ebp - 0x1c], 0
adc eax, 0
cmp dword [ebp - 0x1c], eax
jl 0x1004fda1
jg 0x1004fd9e
cmp ecx, edx
jbe 0x1004fda1
lea ecx, [edi + 1]
push esi
lea eax, [ebp - 4]
mov dword [ebp - 4], ecx
push eax
push ecx
xor edx, edx
mov ecx, ebx
call fcn.10052750
mov ecx, dword [ebp - 0x10]
add esp, 0xc
test eax, eax
je 0x1004fe73
mov byte [esi + 0x1837c], 1
jmp 0x1004fe73
mov edi, dword [esi + 0x7128]
mov edx, edi
mov eax, dword [esi + 0x712c]
add edx, 1
mov ecx, dword [esi + 0x18370]
adc eax, 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x1c], eax
jl 0x1004fe02
jg 0x1004fdfc
cmp ecx, edx
jbe 0x1004fe02
lea ecx, [edi + 1]
mov dword [ebp - 0x18], ecx
lea edi, [esi + 0x1f78c]
mov dword [ebp - 4], ecx
lea eax, [edi + 0x12c]
mov edx, ecx
push eax
mov ecx, ebx
call fcn.1004d0e0
mov ecx, dword [edi + 0x1cc]
xor edx, edx
add esp, 4
mov dword [ebp - 0x14], edx
cmp dword [ebp - 0x18], edx
jbe 0x1004fe6a
mov edi, edi
cmp ecx, 0x10
jne 0x1004fe59
xor eax, eax
add byte [eax + edi], 1
jne 0x1004fe43
inc eax
cmp eax, 8
jb 0x1004fe37
lea eax, [edi + 0x20]
mov ecx, edi
push eax
lea edx, [edi + 0x10]
call fcn.10056120
mov edx, dword [ebp - 0x14]
add esp, 4
xor ecx, ecx
mov al, byte [ecx + edi + 0x10]
inc ecx
xor byte [edx + ebx], al
inc edx
mov dword [ebp - 0x14], edx
cmp edx, dword [ebp - 0x18]
jb 0x1004fe30
mov dword [edi + 0x1cc], ecx
mov ecx, dword [ebp - 0x10]
cmp byte [esi + 0x1837c], 0
jne 0x1004fea9
cmp dword [esi + 0x18370], 0
jbe 0x1004fea9
mov eax, dword [esi + 0x1836c]
movzx eax, byte [eax]
mov word [ecx], ax
mov eax, 8
inc dword [esi + 0x1836c]
dec dword [esi + 0x18370]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov word [ecx], ax
mov dword [esi + 0x18370], eax
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret