Function at 0x4052c0
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5548a9
mov eax, dword fs:[0]
push eax
sub esp, 0x450
mov eax, dword [0x5ad218]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x440], ecx
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x450], eax
mov dword [ebp - 0x45c], ebx
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x448]
mov dword [ebp - 4], 0
push eax
mov ecx, ebx
mov dword [ebp - 0x418], 0
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x438]
push eax
mov ecx, ebx
mov byte [ebp - 4], 1
call fcn.00406160
xor esi, esi
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x438]
or edi, 0xffffffff
mov dword [ebp - 0x434], esi
mov dword [ebp - 0x424], esi
mov dword [ebp - 0x41c], edi
mov ecx, 0x5899fc
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40539b
test dx, dx
je 0x405397
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40539b
add eax, 4
add ecx, 4
test dx, dx
jne 0x405375
xor eax, eax
jmp 0x4053a0
sbb eax, eax
or eax, 1
test eax, eax
sete al
or esi, 0xffffffff
test al, al
jne 0x405df3
mov eax, dword [ebp - 0x438]
mov ecx, 0x589a08
jmp 0x4053c0
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4053e6
test dx, dx
je 0x4053e2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4053e6
add eax, 4
add ecx, 4
test dx, dx
jne 0x4053c0
xor eax, eax
jmp 0x4053eb
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
jne 0x405df3
lea eax, [ebp - 0x438]
push 0x589a10
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405474
push dword [ebp - 0x418]
lea eax, [ebp - 0x440]
push eax
mov ecx, ebx
call fcn.00405fc0
lea edx, [ebp - 0x424]
lea ecx, [ebp - 0x440]
mov byte [ebp - 4], 3
call section..text
xor ecx, ecx
test eax, eax
cmovne edi, ecx
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x440]
add edx, 0xfffffff0
mov dword [ebp - 0x41c], edi
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405469
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x424]
jmp 0x405dff
lea eax, [ebp - 0x438]
push str.HTTP
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x4057e0
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x424]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x424]
push 0x589a24
push eax
mov byte [ebp - 4], 4
call fcn.00406040
add esp, 8
test al, al
je 0x4054d2
mov dword [ebp - 0x43c], 1
jmp 0x40551c
lea eax, [ebp - 0x424]
push str.HEAD
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x4054f6
mov dword [ebp - 0x43c], 2
jmp 0x40551c
lea eax, [ebp - 0x424]
push str.POST
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x4057b2
mov dword [ebp - 0x43c], 0
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x420]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x430]
push eax
mov ecx, ebx
mov byte [ebp - 4], 5
call fcn.00406160
mov byte [ebp - 4], 6
push dword [ebp - 0x430]
call fcn.0052c369
add esp, 4
mov dword [ebp - 0x458], eax
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x42c]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x444]
push eax
mov ecx, ebx
mov byte [ebp - 4], 7
call fcn.00406160
xor edi, edi
mov dword [ebp - 0x44c], edi
xor ebx, ebx
mov dword [ebp - 0x454], ebx
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x444]
mov dword [ebp - 0x41c], ebx
cmp dword [eax - 0xc], ebx
je 0x405695
push eax
call fcn.0052c369
add esp, 4
mov ebx, eax
push 4
call fcn.00406287
add esp, 4
mov dword [ebp - 0x428], eax
mov esi, dword [ebp + 8]
mov byte [ebp - 4], 0xb
test eax, eax
je 0x405606
push ebx
push dword [ebp - 0x418]
mov ecx, esi
push eax
call fcn.00404de0
mov edi, eax
jmp 0x405608
xor edi, edi
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x418]
add eax, ebx
push eax
lea eax, [ebp - 0x418]
push eax
mov ecx, esi
mov dword [ebp - 0x44c], edi
call fcn.00405fc0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
mov byte [ebp - 4], 0xc
mov esi, dword [ebp - 0x418]
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push eax
mov dword [ebp - 0x41c], eax
call fcn.004062b4
add esp, 4
mov ebx, eax
push 0
push 0
push dword [ebp - 0x41c]
mov dword [ebp - 0x454], ebx
push ebx
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
dec dword [ebp - 0x41c]
lea ecx, [ebp - 0x418]
mov byte [ebp - 4], 0xa
call fcn.00401ae0
or esi, 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x440]
mov dword [ebp - 0x428], eax
mov ecx, dword [ecx]
lea eax, [ebp - 0x418]
push eax
push dword [ebp - 0x41c]
lea eax, [ebp - 0x42c]
push ebx
push edi
push eax
push dword [ebp - 0x458]
lea eax, [ebp - 0x420]
push eax
push dword [ebp - 0x43c]
mov dword [ebp - 0x418], 0
call fcn.00401be0
or edi, 0xffffffff
xor ecx, ecx
test eax, eax
cmovne edi, ecx
mov dword [ebp - 0x41c], edi
mov edi, dword [ebp - 0x418]
test edi, edi
je 0x40576b
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x428]
push 4
mov dword [ebp - 0x428], eax
call fcn.00406287
add esp, 4
test eax, eax
je 0x405726
mov ecx, eax
call fcn.00401a30
mov esi, eax
jmp 0x405728
xor esi, esi
push dword [edi]
mov dword [ebp - 0x434], esi
push dword [ebp - 0x428]
push str._lu__s
push esi
call fcn.00402a10
mov edx, dword [edi]
sub edx, 0x10
or esi, 0xffffffff
add esp, 0x10
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405762
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push edi
call fcn.004062bd
add esp, 4
push ebx
mov byte [ebp - 4], 9
call fcn.004062bd
add esp, 4
lea ecx, [ebp - 0x44c]
call fcn.004045f0
lea ecx, [ebp - 0x444]
call fcn.00401ae0
lea ecx, [ebp - 0x42c]
call fcn.00401ae0
lea ecx, [ebp - 0x430]
call fcn.00401ae0
lea ecx, [ebp - 0x420]
call fcn.00401ae0
mov ebx, dword [ebp + 8]
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x424]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4057d5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x434]
jmp 0x405dff
lea eax, [ebp - 0x438]
push str.FILE
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405a62
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x424]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x424]
push str.READ
push eax
mov byte [ebp - 4], 0xd
call fcn.00406040
add esp, 8
test al, al
je 0x405983
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x420]
push eax
mov ecx, ebx
call fcn.00406160
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
mov byte [ebp - 4], 0xe
push dword [ebp - 0x420]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40595e
push 0x3ff
lea eax, [ebp - 0x413]
push 0
push eax
mov byte [ebp - 0x414], 0
call fcn.0052d860
add esp, 0xc
mov dword [ebp - 0x43c], 0
push 4
call fcn.00406287
add esp, 4
test eax, eax
je 0x4058bd
mov ecx, eax
call fcn.00401a30
mov esi, eax
jmp 0x4058bf
xor esi, esi
push 0x400
lea eax, [ebp - 0x414]
push 0
push eax
mov dword [ebp - 0x434], esi
call fcn.0052d860
add esp, 0xc
lea eax, [ebp - 0x43c]
push 0
push eax
push 0x3ff
lea eax, [ebp - 0x414]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40594d
jmp 0x405900
cmp dword [ebp - 0x43c], 0
je 0x40594d
lea eax, [ebp - 0x414]
push eax
mov ecx, esi
call fcn.004012e0
push 0x400
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.0052d860
add esp, 0xc
lea eax, [ebp - 0x43c]
push 0
push eax
push 0x3ff
lea eax, [ebp - 0x414]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405900
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x41c], 0
lea ecx, [ebp - 0x420]
call fcn.00401ae0
mov esi, dword [ebp - 0x434]
lea ecx, [ebp - 0x424]
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
lea eax, [ebp - 0x424]
push str.EXISTS
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405a4c
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x420]
push eax
mov ecx, ebx
call fcn.00406160
mov byte [ebp - 4], 0xf
push dword [ebp - 0x420]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push 4
mov esi, eax
call fcn.00406287
add esp, 4
mov dword [ebp - 0x428], eax
mov byte [ebp - 4], 0x10
test eax, eax
je 0x405a25
mov edx, str.false
mov ecx, str.true
test esi, esi
cmove ecx, edx
push ecx
mov ecx, eax
call fcn.00404ed0
lea ecx, [ebp - 0x420]
mov esi, eax
mov dword [ebp - 0x41c], 0
call fcn.00401ae0
lea ecx, [ebp - 0x424]
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
xor esi, esi
lea ecx, [ebp - 0x420]
mov dword [ebp - 0x41c], esi
call fcn.00401ae0
lea ecx, [ebp - 0x424]
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
lea ecx, [ebp - 0x424]
xor esi, esi
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
lea eax, [ebp - 0x438]
push 0x589a7c
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405b50
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x42c]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x42c]
push str.TRY_CONN
push eax
mov byte [ebp - 4], 0x11
call fcn.00406040
add esp, 8
test al, al
je 0x405c6d
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x430]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x420]
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x12
call fcn.00406160
push 6
push 1
mov byte [ebp - 4], 0x13
mov ecx, dword [ebp - 0x440]
lea eax, [ebp - 0x420]
mov ecx, dword [ecx + 4]
push eax
lea eax, [ebp - 0x430]
push eax
call fcn.00405020
push 4
mov esi, eax
call fcn.00406287
add esp, 4
mov dword [ebp - 0x428], eax
mov byte [ebp - 4], 0x14
test eax, eax
je 0x405c37
mov edx, str.false
test esi, esi
mov ecx, str.true
cmove ecx, edx
push ecx
mov ecx, eax
call fcn.00404ed0
mov esi, eax
jmp 0x405c39
lea eax, [ebp - 0x438]
push 0x589a98
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405c83
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x42c]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x42c]
push str.TRY_CONN
push eax
mov byte [ebp - 4], 0x15
call fcn.00406040
add esp, 8
test al, al
je 0x405c6d
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x430]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x420]
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x16
call fcn.00406160
push 0x11
push 2
mov byte [ebp - 4], 0x17
mov ecx, dword [ebp - 0x440]
lea eax, [ebp - 0x420]
mov ecx, dword [ecx + 4]
push eax
lea eax, [ebp - 0x430]
push eax
call fcn.00405020
push 4
mov esi, eax
call fcn.00406287
add esp, 4
mov dword [ebp - 0x428], eax
mov byte [ebp - 4], 0x18
test eax, eax
je 0x405c37
mov edx, str.false
test esi, esi
mov ecx, str.true
cmove ecx, edx
push ecx
mov ecx, eax
call fcn.00404ed0
mov esi, eax
jmp 0x405c39
xor esi, esi
lea ecx, [ebp - 0x420]
mov dword [ebp - 0x41c], 0
call fcn.00401ae0
lea ecx, [ebp - 0x430]
call fcn.00401ae0
lea ecx, [ebp - 0x42c]
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
lea ecx, [ebp - 0x42c]
xor esi, esi
mov byte [ebp - 4], 2
call fcn.00401ae0
jmp 0x405dff
lea eax, [ebp - 0x438]
push str.EXTRACT_RES
push eax
call fcn.00406040
add esp, 8
test al, al
je 0x405dfd
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x444]
push eax
mov ecx, ebx
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x42c]
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x19
call fcn.00406160
lea eax, [ebp - 0x418]
push eax
push 0x5899f8
lea eax, [ebp - 0x430]
push eax
mov ecx, ebx
mov byte [ebp - 4], 0x1a
call fcn.00406160
mov byte [ebp - 4], 0x1b
push dword [ebp - 0x42c]
push dword [ebp - 0x444]
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
je 0x405dc6
push edi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push edi
push 0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x430]
mov dword [ebp - 0x428], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x405dc6
push 0
lea eax, [ebp - 0x420]
push eax
push esi
push dword [ebp - 0x428]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405dbf
cmp esi, dword [ebp - 0x420]
jne 0x405dbf
push 4
mov dword [ebp - 0x41c], 0
call fcn.00406287
add esp, 4
test eax, eax
je 0x405da3
mov ecx, eax
call fcn.00401a30
mov esi, eax
jmp 0x405da5
xor esi, esi
push dword [ebp - 0x420]
mov dword [ebp - 0x434], esi
push 0x589ab8
push esi
call fcn.00402a10
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x430]
call fcn.00401ae0
lea ecx, [ebp - 0x42c]
call fcn.00401ae0
lea ecx, [ebp - 0x444]
mov byte [ebp - 4], 2
call fcn.00401ae0
mov esi, dword [ebp - 0x434]
jmp 0x405dff
mov dword [ebp - 0x41c], 0
xor esi, esi
test ebx, ebx
je 0x405f21
push 4
call fcn.00406287
mov edi, eax
add esp, 4
mov dword [ebp - 0x428], edi
mov byte [ebp - 4], 0x1c
test edi, edi
je 0x405e3a
mov ecx, dword [ebp - 0x448]
add ecx, 0xfffffff0
push ecx
call fcn.00401b50
add esp, 4
add eax, 0x10
mov dword [edi], eax
jmp 0x405e3c
xor edi, edi
push 1
push 0x5899f8
mov ecx, edi
mov byte [ebp - 4], 2
call fcn.00401910
cmp dword [ebp - 0x41c], 0
mov ecx, str.FAILED
mov eax, str.SUCCEEDED
cmovl eax, ecx
push eax
lea ecx, [ebp - 0x428]
call fcn.00404ed0
mov byte [ebp - 4], 0x1d
mov eax, dword [eax]
mov ecx, edi
push dword [eax - 0xc]
push eax
call fcn.00401910
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x428]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405ea3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test esi, esi
je 0x405ee9
push 1
push 0x5899f8
mov ecx, edi
call fcn.00401910
mov eax, dword [esi]
mov ecx, edi
push dword [eax - 0xc]
push eax
call fcn.00401910
mov edx, dword [esi]
sub edx, 0x10
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405ede
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push esi
call fcn.004062bd
add esp, 4
jmp 0x405f0d
cmp dword [ebp - 0x41c], 0
jge 0x405f0d
push 1
push 0x5899f8
mov ecx, edi
call fcn.00401910
mov eax, dword [ebx]
mov ecx, edi
push dword [eax - 0xc]
push eax
call fcn.00401910
push 0
push edi
push 0x465
push dword [ebp - 0x450]
call dword [sym.imp.USER32.dll_PostMessageW]
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x438]
add edx, 0xfffffff0
or esi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405f47
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x448]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405f6a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
test ebx, ebx
je 0x405f97
mov edx, dword [ebx]
sub edx, 0x10
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x405f8e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
call fcn.004062bd
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0052bb2e
mov esp, ebp
pop ebp
ret 0xc