Function at 0x4038e0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
mov eax, dword [0x421004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x124], eax
push 0x41ed80
mov dword [ebp - 0x110], edi
lea eax, [edi + 0x101d8]
push eax
call fcn.0040a02e
push 2
mov ebx, eax
push 0
push ebx
mov dword [ebp - 0x10c], ebx
call fcn.0040a4b5
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x403c4a
mov dword [ebp - 0x120], eax
cmp dword [edi], eax
jle 0x403aac
add edi, 0x10c
mov dword [ebp - 0x118], edi
push dword [ebp - 0x124]
lea eax, [ebp - 0x108]
push 0x104
push eax
call fcn.0040a5f4
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x403c4a
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403980
sub ecx, edx
cmp byte [ebp + ecx - 0x109], 0x5c
je 0x40399d
mov word [ebp + ecx - 0x108], 0x5c
lea eax, [edi - 0x104]
push eax
lea eax, [ebp - 0x108]
push 0x104
push eax
call fcn.0040a96a
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x403c4a
lea eax, [ebp - 0x108]
push 0x41ed84
push eax
call fcn.0040a02e
mov edi, eax
add esp, 8
test edi, edi
je 0x403b1a
push ebx
call fcn.00409f0c
mov ecx, dword [ebp - 0x118]
add esp, 4
mov dword [ecx], eax
cmp eax, 0xffffffff
je 0x403b0c
mov eax, dword [ebp - 0x110]
xor ebx, ebx
add eax, 0x106e0
mov dword [ebp - 0x11c], eax
nop dword [eax]
push edi
push 0x1000
push 1
push eax
call fcn.0040ab9f
push edi
mov esi, eax
call fcn.00409f17
add esp, 0x14
test eax, eax
je 0x403a34
mov ebx, 1
jmp 0x403a45
push edi
call fcn.00409f42
add esp, 4
test eax, eax
jne 0x403aed
test esi, esi
je 0x403a64
push dword [ebp - 0x10c]
push esi
push 1
push dword [ebp - 0x11c]
call fcn.0040a886
add esp, 0x10
cmp eax, esi
jne 0x403ace
mov eax, dword [ebp - 0x11c]
test ebx, ebx
je 0x403a10
push edi
call fcn.0040a0bb
mov ecx, dword [ebp - 0x120]
add esp, 4
mov eax, dword [ebp - 0x110]
inc ecx
mov edi, dword [ebp - 0x118]
mov ebx, dword [ebp - 0x10c]
add edi, 0x108
mov dword [ebp - 0x120], ecx
mov dword [ebp - 0x118], edi
cmp ecx, dword [eax]
jl 0x403951
mov edi, eax
push 2
push 0
push ebx
call fcn.0040a4b5
mov esi, eax
add esp, 0xc
test esi, esi
je 0x403b22
call fcn.0040a957
push str.Seek_failed
jmp 0x403c40
call fcn.0040a957
push str.Write_failed
mov esi, dword [eax]
call fcn.0040a15f
add esp, 4
push edi
call fcn.0040a0bb
jmp 0x403c47
call fcn.0040a957
push str.Read_failed
mov esi, dword [eax]
call fcn.0040a15f
add esp, 4
push edi
call fcn.0040a0bb
jmp 0x403c47
or esi, 0xffffffff
push edi
call fcn.0040a0bb
jmp 0x403c47
or esi, 0xffffffff
jmp 0x403c4a
xor ebx, ebx
cmp dword [edi], ebx
jle 0x403bbd
add edi, 8
nop
push dword [ebp - 0x10c]
lea eax, [edi + 0x104]
push 1
push 4
push eax
call fcn.0040a886
add esp, 0x10
cmp eax, 1
jne 0x403c36
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403b57
push dword [ebp - 0x10c]
sub ecx, edx
push ecx
push 1
push edi
mov dword [ebp - 0x114], ecx
call fcn.0040a886
add esp, 0x10
cmp eax, dword [ebp - 0x114]
jne 0x403c36
push dword [ebp - 0x10c]
lea eax, [ebp - 0x114]
push 1
push 4
push eax
call fcn.0040a886
add esp, 0x10
cmp eax, 1
jne 0x403c36
mov eax, dword [ebp - 0x110]
inc ebx
add edi, 0x108
cmp ebx, dword [eax]
jl 0x403b30
mov edi, eax
mov ebx, dword [ebp - 0x10c]
push ebx
push 1
push 4
push edi
call fcn.0040a886
add esp, 0x10
cmp eax, 1
jne 0x403c36
lea edx, [edi + 0x102dc]
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403be1
sub ecx, edi
mov dword [ebp - 0x114], ecx
je 0x403c07
push ebx
push ecx
push 1
push edx
call fcn.0040a886
add esp, 0x10
cmp eax, dword [ebp - 0x114]
jne 0x403c36
push ebx
push 1
lea eax, [ebp - 0x114]
push 4
push eax
call fcn.0040a886
add esp, 0x10
cmp eax, 1
jne 0x403c36
push ebx
push 0xf
push eax
push str.GWUPDTEXTRACTOR
call fcn.0040a886
add esp, 0x10
cmp eax, 0xf
je 0x403c4a
call fcn.0040a957
push str.Failed_to_write_trailer
mov esi, dword [eax]
call fcn.0040a15f
add esp, 4
mov eax, dword [ebp - 0x10c]
test eax, eax
je 0x403c5d
push eax
call fcn.0040a0bb
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00404b37
mov esp, ebp
pop ebp
ret 4